<!DOCTYPE html>
<html lang="en">

<head>
  <title>longtask</title>
</head>

<body>
  <script>
    var observer = new PerformanceObserver(function (list) {
      var perfEntries = list.getEntries();
      for (var i = 0; i < perfEntries.length; i++) {
        console.log(perfEntries[i].toJSON())
      }
    });
    observer.observe({
      entryTypes: ["longtask"]
    });
    var t = new Date().getTime()
    while (new Date().getTime() - t < 5000) {

    }
  </script>
</body>

</html>